-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
APIv3: return permissions
expandable field on projects
#10978
Conversation
Add `?expand=permissions` to project list/detail API endpoints. Related readthedocs/ext-theme#128
Add `?expand=permissions` to project list/detail API endpoints. Related readthedocs/ext-theme#128
ef4b5bc
to
ec87791
Compare
@agjohnson I think we want to move away from expandable fields because it's pretty complex. So, we may not want to use this PR at all -- cc @stsewd |
What is the complexity here? This PR is very useful in removing the page load time on project/organization/build listings. If we aren't using expand fields, what other options do we have here for returning this data in a single API request? Does this need to be a second API request from the dashboard? |
This field is specific to the current user, so it shouldn't be a problem. But be aware that this will probably add lots of querysets when listing projects... |
Good point, I am only using this in the detail view. If there is a way to only allow this expansion on detail views, I think that should be enough as well. Or we can monitor this and see if it is ever used/abused. This should never be documented for users, though it is in a public request that users can inspect too. |
Do we need to do anything additional with this PR? This feels like a fairly small change, as are the changes to use this in |
I'm not 100% sure about where we are regarding the expandable fields and this comment from @stsewd. I'm happy to add some test cases to this PR and mark it as ready for review after that if that's the required work here. |
Nope.
+1 on tests |
…mitos/projects-api-permissions
…docs/readthedocs.org into humitos/projects-api-permissions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will likely break tests on .com, make sure to update them after this PR is merged.
Add
?expand=permissions
to project list/detail API endpoints.Related readthedocs/ext-theme#128